package com.yinhe.music.yhmusic.instrument;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yinhe.music.common.GlideHelper.GlideHelper;
import com.yinhe.music.yhmusic.R;

import java.util.List;

public class InstrumentAdapter extends BaseSectionQuickAdapter<InstrumentSection, BaseViewHolder> {

    public InstrumentAdapter(List data) {
        super(R.layout.activity_instrument_item, R.layout.activity_instrument_header, data);
    }

    @Override
    protected void convertHead(BaseViewHolder helper, InstrumentSection item) {
        helper.setText(R.id.tv_national_name, item.header);
    }

    @Override
    protected void convert(BaseViewHolder helper, InstrumentSection item) {
        InstrumentBean.InstrumentListBean bean = item.t;
        ImageView userImage = helper.getView(R.id.img_instrument);
        GlideHelper.setCircleImageResource(userImage, bean.getIcon(),R.drawable.ic_test_instrument);
        helper.setText(R.id.tv_instrument_name, bean.getInstrumentName());
    }
}
